package com.cry.todo.domain.audit;

import org.hibernate.envers.DefaultRevisionEntity;
import org.hibernate.envers.RevisionType;


public class AuditRevision<T> {
	private T lastEntity = null;
	private T entity;
	private AuditRevisionEntity revisionEntity;
	private RevisionType type;
	
	public AuditRevision(Object[] revisionItem, Object[] lastEntity) {
		entity = (T) revisionItem[0];
		if(lastEntity != null) {
			this.lastEntity = (T) lastEntity[0];
		}
		revisionEntity = (AuditRevisionEntity) revisionItem[1];
		type = (RevisionType) revisionItem[2];
	}

	public T getEntity() {
		return entity;
	}

	public void setEntity(T entity) {
		this.entity = entity;
	}

	public AuditRevisionEntity getRevisionEntity() {
		return revisionEntity;
	}

	public void setRevisionEntity(AuditRevisionEntity revisionEntity) {
		this.revisionEntity = revisionEntity;
	}

	public RevisionType getType() {
		return type;
	}

	public void setType(RevisionType type) {
		this.type = type;
	}

	public T getLastEntity() {
		return lastEntity;
	}

	public void setLastEntity(T lastEntity) {
		this.lastEntity = lastEntity;
	}
}
